"""
数据库模块初始化
导出主要的数据库服务和模型
"""

from .database_service import DatabaseService
from .session_dao import SessionModel, MessageModel, SessionDAO, MessageDAO
from .role_dao import CustomRoleModel, RoleTrait, RoleDAO
from .supabase_client import get_supabase_client, test_connection, check_supabase_config

# 延迟初始化数据库服务
db_service = None

def get_db_service():
    """获取数据库服务实例"""
    global db_service
    if db_service is None:
        db_service = DatabaseService()
    return db_service

__all__ = [
    # 服务
    'db_service',
    'get_db_service', 
    'DatabaseService',
    
    # DAO
    'SessionDAO',
    'MessageDAO', 
    'RoleDAO',
    
    # 模型
    'SessionModel',
    'MessageModel',
    'CustomRoleModel',
    'RoleTrait',
    
    # 客户端
    'get_supabase_client',
    'test_connection',
    'check_supabase_config'
]